This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Feb 29, 2012, 4:00 AM
9 Posts

Set sessionScope when Navigation item on click

  • Category: Extension Library
  • Platform: All
  • Release: 8.5.3
  • Role: Developer
  • Tags:
  • Replies: 4
 Hi all , good day
 i have a navigator in my application layout.
 i think of to set sessionScope when navigator item clicked , then based on the sessionscope i want to filter the view to dsplay document match the key.
 how can i do that ? or this approach is not suitable ?
 any example pls share with me . 
 i am really new in xpages, hope to get some help ... thank you very much.   
 hope to hear from you all. 
 
 Regards 
Feb 29, 2012, 9:08 AM
56 Posts
Re: Set sessionScope when Navigation item on click
Hi Yuna,
 
I don't know how your navigator is structured. But you should select each entry and add a serverside onClick event (events-tab in the designer).
Then in this serverside event, you can add some javascript code like this:
 
sessionScope.put("mySessionVariable", "mySessionValue");
 
On the page, which opened, you can use this value with the folowing code:
 
sessionScope.get("mySessionVariable");
 
You can use it as a categoryfilter or compute the datasource or you set a search on the viewControl.
 
Hope this helps.
Feb 29, 2012, 12:15 PM
9 Posts
Re: Set sessionScope when Navigation item on click
 Hi Nick , glad to hear from you ...
 i have tried that but i did not get the thing work, may be i should give more detail. :)
 actually i have a view data with 3 category,   
 so i try to use the view filter by column (some sample view filter, combine all the keys then filter) .
 however i need to fixed the first category value and the 2nd & 3rd can allow user to select from a list. 
 eg : when user click on the menu (cat A) then i fix the (cat A) as the first category as a sessionscope.
 when as the 2nd & 3rd key allow user to select is request scope. 
  
 samething happen when user click menu (cat B)then the view only show Cat B records and user can select the 2nd or 3rd key to make futher filter in the view.
if i have a page link , i will need to build every cat with one page and set the sessionscope before page load . that seem working but by this way i need to have many page , like it is not efficient .
by the way , should i use the basic node in the navigator or which way better ? 
Hope to hear from you ... any suggestion are welcome ... Thank you very much. 
 
Feb 29, 2012, 2:14 PM
56 Posts
Re: Set sessionScope when Navigation item on click
Hi,
 
I don't know what you mean, exactly.
 
What is your navigator, by the way? Is it an extension library control? I didn't wok with them, yet. Please describe what you mean with navigator.
 
I can't imagine what you are doing in your page. I would say, store the sessionScope value for Cat A and then, in the area where you put your key for filtering, you can compute the key with all the values you have, the session values, the request values, and then you are returning this value as the filter and everything should be fine. May something is wrong with your view and the filter doesn't apply.
Also I would check whether your value from requestScope is really existing, there is a little bug from time to time with requestScope, which causes its value not existing.
What do you mean with it doesn't work, anyway? Maybe a little more detailed error message or a description of the error would help.
 
 
Feb 29, 2012, 3:31 PM
9 Posts
Re: Set sessionScope when Navigation item on click
 hi, i am so sorry a little bit confuse here...
 yes, i am using the Navigator in Extension library.
 i am not in office, got to check out again when back to office. thank you for those tips... :)
   

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal